Prettyprinting without Losing Comments

نویسنده

  • M G J Van Den Brand
چکیده

The problem of prettyprinting in generated programming environments is addressed. A practical solution for the prettyprinting process itself as well as for the handling of comments is given. A new box-language is presented for specifying prettyprint rules in an algebraic way. Both the syntax and the semantics of this box-language are formalized. Instead of designing and implementing a formatting machinery in for example C, the transformation from box-language to (prettyprinted) text is formally speciied. This speciication can be executed and its performance is surprisingly good. The box-language and its formatting algorithms suggest a general mechanism to pret-typrint text with comments without losing the comments in the resulting text. There are no restrictions on the form of comments and places where comments may occur in the text. The method is not based on adaptations of the abstract syntax tree, but on modiications of the intermediate box-term that is built when a program is prettyprinted.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Bibliography prettyprinting and syntax checking

bzbview is intended for small personal databases. There may be problems with databases consisting of more than 1000 entries. It is desirable to search in more than one database. The consistency check should be more sophisticated and, for example, look for duplicate entries. The algorithm for key generation is fixed. The user should be able to define his own method for key generation. Comments i...

متن کامل

Bibliography Prettyprinting and Syntax Checking

References 414 Index 415 List of Tables 1 Sample bibclean initialization file. 401 2 Escape sequences in quoted strings. 401 3 Initialization file pattern characters. 402

متن کامل

Tool construction for process centred software development environments based on object databases

Interface OptionalNontermIncrement Figure 9.8: Top-Level Diagram of Inheritance Diagram DelimiterItem PrettyPrinting EntityName TerminalIncrement

متن کامل

Nber Working Paper Series Winning by Losing: Evidence on the Long-run Effects of Mergers

at the AFA and EFA for valuable comments. We thank Zach Liscow for excellent research assistance. The views expressed herein are those of the authors and do not necessarily reflect the views of the National Bureau of Economic Research. NBER working papers are circulated for discussion and comment purposes. They have not been peer-reviewed or been subject to the review by the NBER Board of Direc...

متن کامل

A Literate Programming Tool for Concurrent Clean

Literate programming has attracted some interest in the functional programming community. This paper presents a prettyprinting algorithm used in a literate programming tool for the functional language Concurrent Clean, and discusses some of the issues involved in prettyprinting layout based languages. 1 Literate programming This section introduces the concept of literate programming for those w...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1993